using System.Diagnostics.Contracts;
using Beaker.OpenCube.Render.Maths;

namespace Beaker.OpenCube.Render.Lighting
{
	public sealed class DirectionalLight
		: Light
	{
		private readonly Vector3 _direction;

		public DirectionalLight( Point3 position, Color color, Vector3 direction, double radiance )
			: base( position, color, radiance )
		{
			// precompute scaled color for performance
			_direction = direction;
		}

		/// <summary>
		/// Gets the direction of the light
		/// </summary>
		[Pure]
		public Vector3 Direction
		{
			get { return _direction; }
		}

		public override Vector3 GetDirection( Intersection intersection )
		{
			return _direction;
		}

	}
}